<?php

namespace App\Events\Article;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;


/**
 * 专题点赞｜收藏｜阅读｜展示 操作事件
 */
class OperateEvent
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public int $uid;
    public int $targetId;
    public int $operateType;
    public int $status;
    public int $operateTime;

    /**
     * @param int $uid
     * @param int $targetId
     * @param int $operateType
     * @param int $status
     * @param int $operateTime
     */
    public function __construct(int $uid, int $targetId, int $operateType, int $status, int $operateTime)
    {
        $this->uid         = $uid;
        $this->targetId    = $targetId;
        $this->operateType = $operateType;
        $this->status      = $status;
        $this->operateTime = $operateTime;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return Channel
     */
    public function broadcastOn()
    {
        return new PrivateChannel('channel-name');
    }
}
